home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
picmanip
/
pic_r2z
/
stpm_pi3
/
stpm_pi3.lst
< prev
next >
Wrap
File List
|
1995-05-05
|
4KB
|
189 lines
'
IF XBIOS(4)<>2 ! Check rez
ALERT 0,"Runs in Hi-rez Only!",1," OK ",f% ! Alert for color
STOP ! Exit
ENDIF
'
CLS
PRINT AT(17,3);"ST PrintMaster Graphics to DEGAS .PI3 Converter"
PRINT AT(9,4);"A modifaction of PC PrintMaster Graphics to DEGAS .PI3 Converter"
PRINT AT(20,5);"a freeware program by Larry D. Klotz."
PRINT AT(12,6);"Modified to work with ST style PrintMaster graphics, print"
PRINT AT(8,7);"graphics, preserve paths and autoname files by Bob Weidner 8/20/92"
BOX 50,20,590,130
DO
auto_name%=2
ALERT 2," | | Send screen images to printer ",1,"Yes|No",prt_it%
@open_lib
DO
@get_lib
INC ppage|
@save_pic
IF prt_it%=1
@prt_screen
ENDIF
LOOP UNTIL (EOF(#1)) OR (LOC(#1)>lf%-20)
CLOSE #1
ALERT 2,"Conversion complete.|Do another?",1,"Yes|No/Quit",d%
b1$=""
ppage|=0
IF d%=2
CLOSE #1
STOP
ENDIF
LOOP
'
PROCEDURE open_lib
'
CLS
IF b$=""
b$=".SHP"
cf$="\"
ENDIF
PRINT CHR$(27);"p";
PRINT AT(14,1);" Load ST PrintMaster Library to Convert (.SHP file) "
PRINT CHR$(27);"q";
FILESELECT cf$+"*.SHP",b$,shapefile$
cf=RINSTR(shapefile$,"\")
cf$=LEFT$(shapefile$,cf)
b$=RIGHT$(shapefile$,LEN(shapefile$)-cf)
'
IF shapefile$=""
STOP
ENDIF
'
CLOSE #1
OPEN "I",#1,shapefile$
lf%=LOF(#1)
'
RETURN
'
PROCEDURE get_lib
'
CLS
'
FOR g_row|=0 TO 6
FOR g_col|=0 TO 5
'
DO
IF EOF(#1)
g_row|=6
g_col|=5
b|=&HB
ELSE
b|=INP(#1)
ENDIF
LOOP UNTIL b|=&HB
DO
IF EOF(#1)
g_row|=6
g_col|=5
b|=&H34
ELSE
b|=INP(#1)
ENDIF
LOOP UNTIL b|=&H34
DO
IF EOF(#1)
g_row|=6
g_col|=5
b|=0
ELSE
b|=INP(#1)
ENDIF
LOOP UNTIL b|=0
DO
IF EOF(#1)
g_row|=6
g_col|=5
b|=&H58
ELSE
b|=INP(#1)
ENDIF
LOOP UNTIL b|=&H58
'
FOR x|=0 TO 51
IF EOF(#1)
x|=51
ELSE IF lf%-LOC(#1)<858
FOR p|=0 TO 10
IF EOF(#1)
p|=10
x|=51
ELSE
BGET #1,XBIOS(2)+p|+(x|*80)+321+(g_row|*(55*80))+(g_col|*13),1
ENDIF
NEXT p|
ELSE
BGET #1,XBIOS(2)+(x|*80)+321+(g_row|*(55*80))+(g_col|*13),11
ENDIF
NEXT x|
'
NEXT g_col|
NEXT g_row|
'
RETURN
'
PROCEDURE save_pic
IF b1$=""
b1$=b$
ENDIF
cf1=RINSTR(b1$,".")-1
IF cf1>7
cf1=7
ENDIF
b1$=LEFT$(b1$,cf1)+CHR$(48+ppage|)+".PI3"
SGET screen$
'
n_again:
IF auto_name%<>1
PRINT CHR$(27);"p";
PRINT AT(3,1);" Select destination drive and a file name (suggested file name is provided) ";
PRINT CHR$(27);"q";
FILESELECT cf1$+"*.PI3",b1$,outfile$
'
cf3=RINSTR(outfile$,"\")
npath$=LEFT$(outfile$,cf3)
fname$=RIGHT$(outfile$,LEN(outfile$)-cf3)
cf4=RINSTR(fname$,".")
IF cf4
fname$=LEFT$(fname$,cf4-1)
ENDIF
IF (b1$<>fname$+".PI3") AND (LEN(fname$)<8)
fname$=fname$+CHR$(48+ppage|)
ENDIF
outfile$=npath$+fname$+".PI3"
'
ALERT 2,"Name .PI3 files automatically?| |(Same name files| will not be overwritten)",1,"Yes|No",auto_name%
ELSE
MID$(outfile$,LEN(outfile$)-4,1)=CHR$(48+ppage|)
ENDIF
IF EXIST(outfile$)
ALERT 1,"A file with that name exists.| | | Overwrite file? ",2,"YES|NO",fx%
IF fx%=2
auto_name%=2
GOTO n_again
ENDIF
ENDIF
cf1=RINSTR(outfile$,"\")
cf1$=LEFT$(outfile$,cf1)
b1$=RIGHT$(outfile$,LEN(outfile$)-cf1)
'
SPUT screen$
CLOSE #2
OPEN "O",#2,outfile$
OUT #2,0,2,7,&H77,0,0,6,&H66,6,&H66,5,&H55,5,&H55,4,&H44,4,&H44,3,&H33
OUT #2,3,&H33,2,&H22,2,&H22,1,&H11,1,&H11,0,0,0,0
BPUT #2,XBIOS(2),32000
CLOSE #2
'
RETURN
PROCEDURE prt_screen
LPRINT " Name of file... ";b1$
LPRINT
LPRINT
LPRINT
HARDCOPY
LPRINT CHR$(12);
RETURN